package com.lazyboyl.spring.boot.sharding.sphere.proxy.net.handler.backend.pool;

import com.lazyboyl.spring.boot.sharding.sphere.proxy.config.ProxyConfig;
import com.lazyboyl.spring.boot.sharding.sphere.proxy.net.handler.backend.BackendConnection;

/**
 * @author linzf
 * @since 2021-07-02
 * 类描述： 数据源实体类
 */
public class MySqlDataSource {

    private MySqlDataPool dataPool;

    public MySqlDataSource(MySqlDataPool dataPool) {
        this.dataPool = dataPool;
    }

    public BackendConnection getBackend() {
        return dataPool.getBackend();
    }

    public void recycle(BackendConnection backend){
        dataPool.putBackend(backend);
    }

    public ProxyConfig getProxyConfig(){
        return dataPool.getProxyConfig();
    }

}
